using System;
using System.ComponentModel.DataAnnotations;

namespace ERP.RepositoryManage.Dtos
{
    /// <summary>
    /// 创建采购入库明细DTO
    /// </summary>
    public class CreateProcurementDetailDto
    {
        /// <summary>
        /// 采购入库单ID
        /// </summary>
        [Required(ErrorMessage = "采购入库单ID不能为空")]
        public int ProcurementId { get; set; }

        /// <summary>
        /// 物料ID
        /// </summary>
        [Required(ErrorMessage = "物料ID不能为空")]
        public int MaterialId { get; set; }

        /// <summary>
        /// 仓库ID
        /// </summary>
        public int WarehouseId { get; set; } = 1;

        /// <summary>
        /// 入库数量
        /// </summary>
        [Required(ErrorMessage = "入库数量不能为空")]
        [Range(1, int.MaxValue, ErrorMessage = "入库数量必须大于0")]
        public int InputNum { get; set; }

        /// <summary>
        /// 金额
        /// </summary>
        [Range(0, double.MaxValue, ErrorMessage = "金额不能为负数")]
        public double Money { get; set; }

        /// <summary>
        /// 批次
        /// </summary>
        [StringLength(50, ErrorMessage = "批次长度不能超过50个字符")]
        public string Batch { get; set; } = string.Empty;

        /// <summary>
        /// 入库日期
        /// </summary>
        [Required(ErrorMessage = "入库日期不能为空")]
        public DateTime InDate { get; set; }

        /// <summary>
        /// 是否已检验
        /// </summary>
        public int IsChecked { get; set; } = 0;

        /// <summary>
        /// 描述
        /// </summary>
        [StringLength(500, ErrorMessage = "描述长度不能超过500个字符")]
        public string? Desc { get; set; }
    }
} 